package com.utonw.carloan.net;

import android.content.Context;

import java.util.Map;

public class NetTool implements NetInterface {
    private static NetTool sNetTool;
    private NetInterface mInterface;
    public static NetTool getInstance() {

        if (sNetTool == null){
            synchronized (NetTool.class){
                if (sNetTool == null){
                    sNetTool = new NetTool();
                }
            }
        }
        return sNetTool;
    }

    private NetTool() {
        mInterface = new OkHttp();
    }


    @Override
    public <T> void startRequest(Context context, Boolean isShowLoading, String url, Map map, Class<T> tClass, NetCallBack<T> callBack) {
        mInterface.startRequest(context,isShowLoading,url,map,tClass,callBack);
    }
}
